﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="products.aspx.cs" Inherits="NSX07.products" %>
<%@ Register assembly="System.Web.Entity, Version=3.5.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" namespace="System.Web.UI.WebControls" tagprefix="asp" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <div class="center_title_bar"><asp:label ID="ProductHeader" runat="server" /></div>
   
    <asp:DataList ID="ProductDataList" runat="server" DataKeyField="id" 
        DataSourceID="ProductDataSource" RepeatColumns="3" 
        RepeatDirection="Horizontal">
        <ItemTemplate>
        <div class="prod_box">
            <div class="center_prod_box">
                <div class="product_title">
                    <a href="productdetails.aspx?id=<%#Eval("id") %>"> <asp:Label ID="Label1" runat="server" Text='<%# Eval("name") %>' /></a>
                </div>
                <div class="product_img">
                    <a href="productdetails.aspx?id=<%#Eval("id") %>"><img border="0"  alt="" src='<%# Eval("imageUrl") %>' width="100" height="140"></a>
                </div>
                <div class="prod_price">
                    price: $<span class="price"><%# Eval("price") %></span>
                </div>                
            </div>
            <div class="prod_details_tab">
                <a class="prod_buy" href="">Add to Cart</a>
                <a class="prod_details" href="productdetails.aspx?id=<%#Eval("id") %>"">Details</a>
            </div>
        </div>
        </ItemTemplate>
    </asp:DataList>
    
        
         <div id="Navigation" class="center_bar_link" runat="server">

                <div id="leftnav">
                    &nbsp;
                    <a id="PreviousPageNav" runat="server"> &lt;&lt; Previous Products</a>
                </div>
                
                <div id="rightnav">
                    &nbsp;
                    <a id="NextPageNav" runat="server">More Products &gt;&gt;</a>
                </div>
            
                <div id="numnav">
                    <asp:Label ID="PagerLocation" runat="server" />
                </div>
            
            </div>
    
    
    
    
    <asp:ObjectDataSource ID="ProductDataSource" runat="server" 
        OldValuesParameterFormatString="original_{0}" 
        SelectMethod="GetProductsByCategoryId" 
        TypeName="NSX07.App_Code.MyDalLayerTableAdapters.ProductTableAdapter" 
        OnSelected="ProductDataSource_Selected" DeleteMethod="Delete" >
     
        <DeleteParameters>
            <asp:Parameter Name="Original_id" Type="Int32" />
        </DeleteParameters>
     
        <SelectParameters>
            <asp:QueryStringParameter DefaultValue="1" Name="categoryid" 
                QueryStringField="id" Type="Int32" />
            <asp:QueryStringParameter DefaultValue="0" Name="PageIndex" 
                QueryStringField="PageIndex" Type="Int32" />
            <asp:Parameter Name="NumRows" Type="Int32" DefaultValue="12" />
            <asp:Parameter Direction="InputOutput" Name="CategoryName" Type="String" />
            <asp:Parameter Direction="InputOutput" Name="CategoryProductCount" 
                Type="Object" />
        </SelectParameters>

    </asp:ObjectDataSource>
    </asp:Content>
